package org.huanmin.controller;

import com.gitee.huanminabc.utils_tools.web_base.utils.HttpJsonResponse;
import lombok.extern.slf4j.Slf4j;
import org.huanmin.handle.BaijiahaoHandle;
import org.huanmin.model.param.UserInfoParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/baijiahao")
@Slf4j
public class BaijiahaoController {

    @Autowired
    private BaijiahaoHandle baijiahaoHandle;


    //http://localhost:9142/baijiahao/logins

    /**
     * 登录
     * @return
     * @throws InterruptedException
     */
    @PostMapping("/logins")
    public HttpJsonResponse<Boolean> logins(@RequestBody List<UserInfoParam> list) throws InterruptedException {
        baijiahaoHandle.logins(list);
        return HttpJsonResponse.success(true);
    }

    //批量生成文章
    @PostMapping("/createBathContent")
    public HttpJsonResponse<Boolean> createBathContent(@RequestBody List<String> list) throws InterruptedException {
        baijiahaoHandle.createBathContent(list);
        return HttpJsonResponse.success(true);
    }

    //批量生成文章
    @PostMapping("/createBathImages")
    public HttpJsonResponse<Boolean> createBathImages(@RequestBody List<String> list) throws InterruptedException {
        baijiahaoHandle.createBathImages(list);
        return HttpJsonResponse.success(true);
    }
    //批量生成文章
    @PostMapping("/bathPush")
    public HttpJsonResponse<Boolean> bathPush(@RequestBody List<String> list) throws InterruptedException {
        baijiahaoHandle.bathPush(list);
        return HttpJsonResponse.success(true);
    }

}
